<?php
//
// +------------------------------------------------------------------------+
// | PHP Version 5.4                                                        |
// +------------------------------------------------------------------------+
// | Copyright (c) All rights reserved.                                     |
// +------------------------------------------------------------------------+
// | 世纪车来车往(北京）网络科技有限公司 版权所有！                               |
// | TEL:010-63732365  HOTLINE:400-6688-365  EMAIL:clcw@clcw.com.cn         |
// | $Revision: 1.0 $                                                       |
// +------------------------------------------------------------------------+
// | Author: xiangminghu@clcw.com.cn                                        |
// +------------------------------------------------------------------------+
//

namespace AuctionBack\Logic;


class OrderSceneLogic extends BaseLogic
{
    protected $autoCheckFields = false;

    protected $orderSceneModel;

    public function _initialize()
    {
        $this->orderSceneModel = D('OrderScene', 'Model');
    }

    /**
     * 获取拍卖场次
     *
     * @param int $sceneId
     */
    public function getOrderSceneInfo($sceneId = 0)
    {
        if (empty($sceneId)) {
            return false;
        }
        $condition = [];
        $condition['scene_id'] = $sceneId;
        return $this->orderSceneModel->where($condition)->find();
    }

    /**
     * 获取竞标状态场次
     *
     * @param int $status
     */
    public function getOrderSceneByStatus($status = 1)
    {
        if (empty($status)) {
            return false;
        }
        $condition = [];
        $condition['status'] = $status;
        return $this->orderSceneModel->where($condition)->group('`scene_id`')->select();
    }

}